/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package beans;

import daos.HistoricoDAO;
import entitys.HistoricoPartida;
import entitys.Partida;
import javax.faces.bean.ManagedBean;

/**
 *
 * @author Amauri
 */
@ManagedBean
public class AdministrarPartidaBean {
    
    private Partida partida;
    private HistoricoPartida hist_partida;
    private HistoricoDAO hist_dao;

    public AdministrarPartidaBean(){
        hist_partida = new HistoricoPartida();
        hist_dao = new HistoricoDAO();
        partida = new Partida();
    }
    
    public String administrarPartida(Partida part){
        return "partida_administrar";
    }
    
    public String SalvarJogada(){
        this.getHist_dao().persistir(this.getHist_partida());
        
        this.setHist_partida(new HistoricoPartida());
        
        return null;
    }
    
    public HistoricoDAO getHist_dao() {
        return hist_dao;
    }

    public void setHist_dao(HistoricoDAO hist_dao) {
        this.hist_dao = hist_dao;
    }

    public Partida getPartida() {
        return partida;
    }

    public void setPartida(Partida partida) {
        this.partida = partida;
    }

    public HistoricoPartida getHist_partida() {
        return hist_partida;
    }

    public void setHist_partida(HistoricoPartida hist_partida) {
        this.hist_partida = hist_partida;
    }
    
}
